<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>优惠接力</title>
	<script type="text/javascript">
		var GID = "shuqian";
		var SCORE_LIMIT = '{php echo $money_start}';
		var actid = '{php echo $act['id']}';
		var help_mid = '{php echo $help_mid}';
		var APP_LIST_URL = '';
		var token = '';
        var ajaxurl = "../api.php?this=custom&token="+token+"&plugin=jy_yousetli&action=check&id="+actid;
	</script>
<script type="text/javascript" src="../addons/jy_yousetli/resource/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../addons/jy_yousetli/resource/js/jquery.cookie.js"></script>
<script type="text/javascript" src="../addons/jy_yousetli/resource/js/createjs-2013.12.12.min.js"></script>
<script type="text/javascript" src="../addons/jy_yousetli/resource/js/qipa_app.js"></script>
<script type="text/javascript" src="../addons/jy_yousetli/resource/js/qipa_stage.js"></script>
<script type="text/javascript" src="../addons/jy_yousetli/resource/js/main.js"></script>
<style type="text/css">
html,body,canvas {
	margin: 0px;
	padding: 0px;
	border:none;
	text-align: center;
	background-color: black;
}
</style>
</head>
<body>
<canvas id="stage">您的浏览器不支持html5, 请换用支持html5的浏览器。</canvas>
<script>
function dp_share(){
			//document.title ="我<?php echo $info['playtime'];?>秒内获得了<?php echo $info['discount_type']==1?'':'下降';?>"+roundFun(myData.score,2)+"<?php echo $info['discount_type']==1?'元':'折';?>的优惠，手都快抽筋，你也来试试看！";
			document.getElementById("share").style.display="";
			//window.shareData.tTitle = document.title;
}
</script>
<div id="share" style="display: none">
			<img width="100%" src="../addons/jy_yousetli/resource/images/share-guide.png" style="position: fixed; z-index: 9999; top: 0; left: 0;background: rgba(0,0,0,0.7);" ontouchstart="document.getElementById('share').style.display='none';" />
</div>
<script type="text/javascript">
function check(){
		$.ajax({
				type:"POST",
				url:"../custom/index.php?plugin=jy_yousetli&action=game&op=check&id="+actid+'&help_mid='+help_mid,
				dataType:"json",
				success:function(data){
					alert(JSON.stringify(data));
					if(data.message.error == 1){
							alert('次数已用完');
							window.location.href=data.message.url;
							return false
					}
				}
		});
}
function upgamelog(){
		$.ajax({
				type:"POST",
				url:"../custom/index.php?plugin=jy_yousetli&action=game&op=check&id="+actid+'&help_mid='+help_mid,
				dataType:"json",
				success:function(data){
					alert(JSON.stringify(data));
					if(data.message.error == 1){
							alert('次数已用完');
							window.location.href=data.message.url;
							return false
					}
				}
		});
}
var myData = { gameid: "sq" };
function dp_submitScore(score){
			myData.score = score;
			myData.scoreName = "数了"+score+"元";
			if(score>0){
				//	var this_discount = round(score,2);
					var this_discount = Math.floor(score * 100) / 100;
					$.ajax({
						type:"POST",
						url:"../custom/index.php?this=custom&plugin=jy_yousetli&action=game&op=count&id="+actid+"&score="+this_discount+'&help_mid='+help_mid,
						dataType:"json",
						success:function(data){
							if(data.error == 0){
								
							}
						}
					});
					dp_share();
					document.getElementById("share").style.display="none";
			}
}
</script>
<script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script type="text/javascript">
window.sharedata='{$return["sharedata"]}';
var jssdkconfig="{$_SESSION['account']['jssdkconfig']";
	jssdkconfig.debug = false;
	jssdkconfig.jsApiList = [
		'checkJsApi',
		'onMenuShareTimeline',
		'onMenuShareAppMessage',
		'onMenuShareQQ',
		'onMenuShareWeibo',
		'hideMenuItems',
		'showMenuItems',
		'hideAllNonBaseMenuItem',
		'showAllNonBaseMenuItem',
		'translateVoice',
		'startRecord',
		'stopRecord',
		'onRecordEnd',
		'playVoice',
		'pauseVoice',
		'stopVoice',
		'uploadVoice',
		'downloadVoice',
		'chooseImage',
		'previewImage',
		'uploadImage',
		'downloadImage',
		'getNetworkType',
		'openLocation',
		'getLocation',
		'hideOptionMenu',
		'showOptionMenu',
		'closeWindow',
		'scanQRCode',
		'chooseWXPay',
		'openProductSpecificView',
		'addCard',
		'chooseCard',
		'openCard',
		'openAddress',
		'openBusinessView'
	];
	wx.config(jssdkconfig);
	wx.ready(function (){
		window.config.wxready=true;
		if(window.after_wxready_func.length>0){
			window.after_wxready_func.forEach(function(func){
				func();
			});
		}
		wx.onMenuShareAppMessage(window.sharedata);
		wx.onMenuShareTimeline(window.sharedata);
		wx.onMenuShareQQ(window.sharedata);
		wx.onMenuShareWeibo(window.sharedata);
	});
</script>
<?php
$helps_sum = $helps_sum?$helps_sum:0;
if($info['discount_type']==1){
	$youhuizhi = $helps_sum.'元';
}else{
	$youhuizhi = (10 - $helps_sum)<$info['discount_min']?$info['discount_min']:(10 - $helps_sum);
	$youhuizhi = $youhuizhi.'折';
}
?>
</body>
</html>
